-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change onehot
to oneelement
#26
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #26 +/- ##
==========================================
+ Coverage 46.23% 48.08% +1.85%
==========================================
Files 5 6 +1
Lines 186 183 -3
==========================================
+ Hits 86 88 +2
+ Misses 100 95 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I see what you mean. Just from the name "one hot" I would have thought things like having multiple ones and a single row or column would be forbidden (here I am referring to the example at that link). But apparently this is the usage in ML, and also one element is just a much clearer name. |
They call that more general case a |
onehot
isn't quite right for the ITensor constructor that creates a tensor with a single nonzero element, see OneHotArrays.jl.There is precedent from
FillArrays.jl
andZygote.jl
for calling a sparse array with a single nonzero elementOneElement
(https://github.com/JuliaArrays/FillArrays.jl), so here I am changingonehot
tooneelement
.In the latest, this is implemented based on a new type
SparseArraysBase.OneElementArray
with an associated generic constructorSparseArraysBase.oneelement
in a package extension, see ITensor/SparseArraysBase.jl#26.See also #5, ITensor/SparseArraysBase.jl#24.